import request from "@/utils/request";

// 获取员工列表
export function getStaffApi(data) {
    return request({
      url: "/institution/staff/employees",
      method: "get",
      params: data,
    });
  }

  // 新增获取角色列表
export function getStaffRolesApi(data) {
    return request({
      url: "/institution/staff/",
      method: "get",
      params: data,
    });
  }

  // 新增员工保存
  export function saveStaffApi(data) {
    return request({
      url: "/institution/staff/add",
      method: "post",
      data: data,
    });
  }

  // 修改获取员工信息
  export function getStaffInfoApi(userId) {
    return request({
      url: '/institution/staff/' + userId,
      method: 'get'
    })
  }

  // 修改员工信息
export function updateStaffApi(data) {
  return request({
    url: '/institution/staff/',
    method: 'put',
    data: data
  })
}

// 删除员工
export function deleteStaffApi(userId) {
  return request({
    url: '/institution/staff/' + userId,
    method: 'delete'
  })
}

// 获取角色管理角色列表
export function getRoleDataListApi(data) {
  return request({
    url: "/institution/staff/roles",
    method: "get",
    params: data,
  });
}

// /institution/staff/roleUsers
// 获取角色管理所属员工
export function getRoleUsersApi(data) {
  return request({
    url: "/institution/staff/roleUsers",
    method: "get",
    params: data,
  });
}

